<?php 
if ((!defined('NV_SYSTEM')) AND (!defined('NV_ADMIN'))) { 
Header("Location: ../index.php"); 
exit; 
} 
global $prefix, $db;  
$limit = 10; //so ban tin 
$Scroll = 1;//Co cho noi dung cua block chay tu duoi len tren hay khong. 0 - khong, 1 - dong y 
$bgcolor1 = "#FFFFAA";
$bgcolor2 = "#06FF83";
############### Het phan khai bao ########################## 

$result1 = $db->sql_query("SELECT pid, hometext FROM ".$prefix."_vanban  ORDER BY pid DESC LIMIT $limit"); 
$numstories = $db->sql_numrows($result1); 
$a = 1; 
$content = ""; 
if($numstories > 0) { 
	
$content .= "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\n<tr>\n<td>"; 
	//Neu cho chay ban tin
if ($Scroll) { 
$content .= "<marquee behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"180\" scrollamount= \"1\" scrolldelay= \"5\" onmouseover='this.stop()' onmouseout='this.start()'>";
} 
	//Bang chua tung ban tin
$content .= "<table width=\"100%\" border=\"0\" bordercolor=\"#000080\" cellpadding=\"0\" cellspacing=\"1\" width=\"100%\">\n"; 
while ($rowlast1 = $db->sql_fetchrow($result1)) { 
$pid = intval($rowlast1['pid']); 

$hometext = stripslashes(check_html($rowlast1['hometext'], "nohtml")); 

$bgcolor23 = $bgcolor1;
if ($a%2 == 1) { $bgcolor23 = $bgcolor2; }
$content .= "<tr>\n<td><table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" width=\"100%\" bgcolor=\"$bgcolor23\"><tr>\n";
$content .= "<td width=\"100%\" align=\"left\"><a href=\"modules.php?name=Vanban&go=page&pid=$pid\">$hometext</a></td></tr></table></td>\n</tr>\n"; 
$a=$a+1; 
} 

$content .= "</table>\n"; 
if ($Scroll) { 
$content .= "</marquee>"; 
} 
$content .= "</td>\n</tr>\n</table>\n"; 
} 
?> 